package com.shilan.dllo.wangyi.util;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.shilan.dllo.wangyi.application.MyApplication;

/**
 * Created by dllo on 15/10/23.
 */
public class VolleySingleton {

    private RequestQueue queue;

    public  VolleySingleton(){ queue = getQueue();}


    public  RequestQueue getQueue(){
        if(queue == null){
            queue = Volley.newRequestQueue(MyApplication.getContext());
        }
        return  queue;
    }

    public <T> void  addRequest(Request<T> request ,Object tag){
        if(request == null){
            synchronized ((VolleySingleton.class)){

            }
        }
    }
    public  void  removeAll(Object tag){ queue.cancelAll(tag);}
}
